package cn.edu.cug.cs.gtl.plugins.redner4oi.nodes;

import cn.edu.cug.cs.gtl.apis.render.nodes.Node;
import com.openinventor.inventor.nodes.SoGroup;
import com.openinventor.inventor.nodes.SoNode;
import com.openinventor.inventor.nodes.SoSeparator;

public class NodeImpl  implements Node {

    protected SoNode nativeObject=null;
    protected Object userData=null;

    @Override
    public Object getNativeObject() {
        return nativeObject;
    }

    @Override
    public boolean attach(Object nativeObject) {
        if(nativeObject instanceof SoNode)
            this.nativeObject = (SoNode)nativeObject;
        else
            return false;
        return true;
    }

    @Override
    public Object detach() {
        SoNode n = nativeObject;
        nativeObject = null;
        return n;
    }


    protected NodeImpl() {
    }

    public NodeImpl(SoNode n){
        this.nativeObject = n;
    }

    @Override
    public Object getUserData() {
        return this.userData;
    }

    @Override
    public void setUserData(Object userData) {
        this.userData = userData;
    }



}
